<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>奖励明细</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
.aui-content{
  padding: 0 0.75rem;
}
.tit{
  font-size: 0.6rem;
  color: #373336;
  padding: 0.6rem 0;
  text-align: center;
  background: #F5F7F8;
}
.notice{
  padding: 0.8rem 0.25rem 0.3rem;
}
.inner{
  padding: 0 1.4rem;
  font-size: 0.6rem;
  color: #FF8028;
  text-align: left;
  background: #FFF1E5;
  border: 1px solid #FFC9AE;
  border-radius: 4px;
}
.inner .padded-tb{
  padding: 0.55rem 0;
}
.dotted{
  border-bottom: 2px dotted  #FFC9AE;
}
.orderInfo{
  padding: 0.8rem 0;
}
.orderInfo .top-name .head > img{
  border-radius: 50%;
  margin-right: 0.3rem;
}
.member {
  width: 2.8rem;
  height: 0.7rem;
  display: inline-block;
  margin-left: 0.7rem;
}
.member.tag-pt {
  /*background: url('../../image/mine/2.png') no-repeat;
  background-size: auto 0.7rem;*/
}
.member.tag-y {
  background: url('../../image/mine/2.png') no-repeat;
  background-size: auto 0.7rem;
}

.member.tag-vip {
  background: url('../../image/mine/3.png') no-repeat;
  background-size: auto 0.7rem;
}

.member.tag-cj {
  background: url('../../image/mine/4.png') no-repeat;
  background-size: auto 0.7rem;
}

.payBtn{
  height: 1rem;
  line-height: 1.1rem;
  padding: 0rem 0.5rem;
  background: #FA7D83;
  text-align: center;
  font-size:0.5rem;
  color:#fff;
  border-radius: 0.1rem;
}
.moneyBox{
  padding-top: 0.7rem;
}
.media{
  width: 3.6rem;
  height: 3.6rem;
  margin-right: 0.4rem;
}
.notData{
  text-align: center;
}
.notBtn{
  background: #E73450;
  border-radius: 5rem;
  height: 2.5rem;
  color:#fff;
  font-size:0.7rem;
  text-align: center;
  line-height: 2.5rem;
}
.padded-tb-32{
  padding-top: 1.6rem;
  padding-bottom: 1.2rem;
}
.orderInfo .tag {
  margin-top: -0.1rem;
  margin-right: 0.4rem;
  display: inline-block;
  color: #FFF;
  background: #FA7D83;
  border-radius: 0.1rem;
  font-size: 0.4rem;
  padding: 0 0.15rem;
  line-height: 0.75rem;
  vertical-align: middle;
}

.orderInfo .tag.on {
  background: #FFC667;
}
.notData{
    left: 0rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
</style>
</head>
<body>
  <div class="tit" tapmode onclick="openZc()">每月22日，结算上个月「确认收货」的订单。了解具体>></div>
  <div class="aui-content">
    <div class="notice">
      <div class="inner">
        <div class="padded-tb">为保护他人隐私，团队奖励不展示具体购买的商品~</div>
        <div class="dotted"></div>
        <div class="padded-tb" tapmode onClick="">升级为运营商，即可获得B级及以下层级的奖励。</div>
      </div>
    </div>
    <!-- 无奖励明细显示 -->
    <div class="notData aui-hide bg-white">
      <img src="../../image/notdata/12.png" class="notImg" alt="">
      <div class="aui-font-size-14 color-ad">暂无您的团队奖励</div>
      <div class="aui-font-size-12 color-35 padded-tb-32">去教教您的团队如何推广成交吧！</div>
      <div class="notBtn" style="right:0.79rem" tapmode onclick="openZc()">有蜜 学习讲堂</div>
    </div>

      <div id="data_html">

      </div>
      <script type="text/x-dot-template" id="data_tpl">
        {{ for(var i in it){ }}
        <div class="orderInfo aui-border-b">
              <div class="aui-flex-col top-name aui-flex-middle">
                <div class="head"><img src="{{=it[i].user_avatar}}" style="height:1rem" alt=""></div>
                <div class="aui-font-size-12 color-35 userName">{{=it[i].user_nickname}}</div>
                {{ if(it[i].user_vip == 1){}}
                <div class="member tag-pt"></div>
                {{}else if(it[i].user_vip == 2){}}
                <div class="member tag-vip"></div>
                {{}else if(it[i].user_vip == 3){}}
                <div class="member tag-y"></div>
                {{}else if(it[i].user_vip == 4){}}
                <div class="member tag-cj"></div>
                {{}}}
              </div>
              <div class="aui-font-size-12 color-ad aui-padded-t-10 aui-padded-b-10">
              {{if(it[i].data_type ==1){}}
              <span class="tag on">淘宝客</span>
              {{}else if(it[i].data_type ==2){}}
              <span class="tag">大礼包</span>
              {{} else if(it[i].data_type == 3){}}
              <span class="tag on">自营商品</span>
              {{}}}
              {{=it[i].create_time}} <span>创建</span></div>
              <div class="aui-flex-col">
              {{if(it[i].data_type == 1){}}
                <div class="media"><img src="../../image/common/tkLogo.png" class="shopImg" alt=""></div>
              {{}else{}}
                <div class="media"><img src="../../image/common/applogo02.jpg" class="shopImg" alt=""></div>
              {{}}}
                <div class="flex-auto">
                  <div class="aui-flex-col aui-flex-between">
                  {{if(it[i].data_type ==1){}}
                    <div class="aui-font-size-12 color-000 flex-auto aui-ellipsis-2">用户自选商品</div>
                  {{}else{}}
                    <div class="aui-font-size-12 color-000 flex-auto aui-ellipsis-2">有蜜精选商品</div>
                  {{}}}
                    <div></div>
                    {{if(it[i].data_status == 1){ }}
                    <div class="payBtn">已付款</div>
                    {{ } else if(it[i].data_status == 2){ }}
                    <div class="payBtn">预估</div>
                    {{ } else if(it[i].data_status == -1){ }}
                    <div class="payBtn" style="background: #ccc">已失效</div>
                    {{ } else if(it[i].data_status == 3){ }}
                    <div class="payBtn">已结算/已收货</div>
                    {{}}}
                  </div>
                  <div class="moneyBox aui-flex-col aui-flex-between">
                    <div class="color-666 aui-font-size-12">买家付款金额<span>￥{{=it[i].pay_price}}</span></div>
                    <div class="color-e7 aui-font-size-12">团队奖励<span>￥{{=it[i].data_commission || '0.00'}}</span></div>
                  </div>
                </div>
              </div>
            </div>
        {{ } }}
      </script>
  </div>
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
var TYPE = 0;
apiready = function(){
	api.parseTapmode();
  getReward();
  var userInfo = getUserinfo();
};
function openZc(){
  api.openWin({
      name: 'zc_xs_win',
      url: 'zc_xs_win.html',
      pageParam: {
          title: '新手课堂'
      }
  });

}
function changeItem(n){
	switch (n) {
		case 0:
			TYPE = 0;
			break;
		case 1:
			TYPE = 1;
			break;
		case 2:
			TYPE = 2;
			break;
		case 3:
			TYPE = 3;
			break;
		default:
			TYPE = 0;
	}
	getReward();
}
function getReward(){
  api.ajax({
      url: BASE_URL_2 + 'App/Commission/orderReward',
      method: 'post',
      data: {
          values: {
              userid: getUserId(),
              type: TYPE
          }
      }
  },function(ret, err){
    console.log(JSON.stringify(ret))
      if (ret && ret.code == 1) {
        $$('.notData').addClass('aui-hide')
        var tpl = $$('#data_tpl').html();
        var tempFn = doT.template(tpl);
        $$('#data_html').html(tempFn(ret.data));
      } else {
        $$('.notData').removeClass('aui-hide')
        $$('#data_html').html()
      }
  });
}
function openvipInvio(){
  api.openWin({
      name: 'vip_invio_win',
      url: 'vip_invio_win.html'
  });

}
</script>
</html>
